package com.song.studylineserver.domain;

import java.io.Serializable;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

/**
 * 
 * @TableName sl_topic
 */
@TableName(value ="sl_topic")
@Data
public class Topic implements Serializable {
    /**
     * 题目序号
     */
    @TableId(type = IdType.AUTO)
    private String topicId;

    /**
     * 题目名称
     */
    private String topicName;

    /**
     * 题目作者
     */
    private String topicAuthor;

    /**
     * 题目范围
     */
    private String topicDomain;

    /**
     * 题目类型
     */
    private String topicType;

    /**
     * 题目内容
     */
    private String topicContent;

    /**
     * 题目选项
     */
    private String topicSelect;

    /**
     * 题目答案
     */
    private String topicAnswer;

    /**
     * 答案详解
     */
    private String topicKnow;

    /**
     * 题目难易度
     */
    private Integer topicHard;

    /**
     * 题目分数
     */
    private Date topicCreate;

    /**
     * 参考分数
     */
    private Double topicScore;

    /**
     * 
     */
    private String topicImage;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Topic other = (Topic) that;
        return (this.getTopicId() == null ? other.getTopicId() == null : this.getTopicId().equals(other.getTopicId()))
            && (this.getTopicName() == null ? other.getTopicName() == null : this.getTopicName().equals(other.getTopicName()))
            && (this.getTopicAuthor() == null ? other.getTopicAuthor() == null : this.getTopicAuthor().equals(other.getTopicAuthor()))
            && (this.getTopicDomain() == null ? other.getTopicDomain() == null : this.getTopicDomain().equals(other.getTopicDomain()))
            && (this.getTopicType() == null ? other.getTopicType() == null : this.getTopicType().equals(other.getTopicType()))
            && (this.getTopicContent() == null ? other.getTopicContent() == null : this.getTopicContent().equals(other.getTopicContent()))
            && (this.getTopicSelect() == null ? other.getTopicSelect() == null : this.getTopicSelect().equals(other.getTopicSelect()))
            && (this.getTopicAnswer() == null ? other.getTopicAnswer() == null : this.getTopicAnswer().equals(other.getTopicAnswer()))
            && (this.getTopicKnow() == null ? other.getTopicKnow() == null : this.getTopicKnow().equals(other.getTopicKnow()))
            && (this.getTopicHard() == null ? other.getTopicHard() == null : this.getTopicHard().equals(other.getTopicHard()))
            && (this.getTopicCreate() == null ? other.getTopicCreate() == null : this.getTopicCreate().equals(other.getTopicCreate()))
            && (this.getTopicScore() == null ? other.getTopicScore() == null : this.getTopicScore().equals(other.getTopicScore()))
            && (this.getTopicImage() == null ? other.getTopicImage() == null : this.getTopicImage().equals(other.getTopicImage()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getTopicId() == null) ? 0 : getTopicId().hashCode());
        result = prime * result + ((getTopicName() == null) ? 0 : getTopicName().hashCode());
        result = prime * result + ((getTopicAuthor() == null) ? 0 : getTopicAuthor().hashCode());
        result = prime * result + ((getTopicDomain() == null) ? 0 : getTopicDomain().hashCode());
        result = prime * result + ((getTopicType() == null) ? 0 : getTopicType().hashCode());
        result = prime * result + ((getTopicContent() == null) ? 0 : getTopicContent().hashCode());
        result = prime * result + ((getTopicSelect() == null) ? 0 : getTopicSelect().hashCode());
        result = prime * result + ((getTopicAnswer() == null) ? 0 : getTopicAnswer().hashCode());
        result = prime * result + ((getTopicKnow() == null) ? 0 : getTopicKnow().hashCode());
        result = prime * result + ((getTopicHard() == null) ? 0 : getTopicHard().hashCode());
        result = prime * result + ((getTopicCreate() == null) ? 0 : getTopicCreate().hashCode());
        result = prime * result + ((getTopicScore() == null) ? 0 : getTopicScore().hashCode());
        result = prime * result + ((getTopicImage() == null) ? 0 : getTopicImage().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", topicId=").append(topicId);
        sb.append(", topicName=").append(topicName);
        sb.append(", topicAuthor=").append(topicAuthor);
        sb.append(", topicDomain=").append(topicDomain);
        sb.append(", topicType=").append(topicType);
        sb.append(", topicContent=").append(topicContent);
        sb.append(", topicSelect=").append(topicSelect);
        sb.append(", topicAnswer=").append(topicAnswer);
        sb.append(", topicKnow=").append(topicKnow);
        sb.append(", topicHard=").append(topicHard);
        sb.append(", topicCreate=").append(topicCreate);
        sb.append(", topicScore=").append(topicScore);
        sb.append(", topicImage=").append(topicImage);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}